package cn.sciento.onelink.sim.data.usage;

import cn.sciento.onelink.CommonResponse;
import cn.sciento.onelink.LinkRequest;
import cn.sciento.onelink.utils.ParamUtil;
import cn.sciento.onelink.utils.TransIdUtil;
import lombok.Builder;
import lombok.Data;

import java.util.HashMap;
import java.util.Map;

/**
 * 单卡本月流量累计使用量查询
 * @author walton
 */
@Data
@Builder
public class SimDataUsageRequest extends LinkRequest<CommonResponse<SimDataUsageResult>> {
    private String appId;

    private String token;

    private String msisdn;

    private String iccid;

    private String imsi;

    public SimDataUsageRequest(String appId, String token, String msisdn, String iccid, String imsi) {
        super(LinkRequest.Method.GET);
        Map<String, Object> bodyMap = new HashMap();
        this.appId = appId;
        this.token = token;
        this.msisdn = msisdn;
        this.iccid = iccid;
        this.imsi = imsi;
        this.path="/ec/query/sim-data-usage";
        Map<String, Object> headMap = new HashMap();
        this.setHeader(headMap);
        bodyMap.put("transid", TransIdUtil.generate(appId));
        bodyMap.put("token", token);
        bodyMap.putAll(ParamUtil.paramJudge(msisdn, iccid, imsi));
        this.setCompleteUrl(this.path,bodyMap);
    }
}